package com.hanamaki.struct;

import java.util.Scanner;

public class ContinueDemo2 {
    /**
     * break 和 continue 的区别
     * break 终止循环
     * continue 跳过当前循环 执行下一次循环
     * @param args
     */

    public static void main(String[] args) {

//        循环录入Java课的学生成绩，统计分数大于等于 80分的学生比例
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入学生的总数");
        int num = scanner.nextInt();
        for (int i = 1; i <= num; i++) {
            System.out.println("请输入第" + i + "个学生成绩");
            double score = scanner.nextDouble();
            if (score < 80) {
                continue;
            }
            count++;
        }
        System.out.println(num);
        System.out.println(count);

        System.out.println((double) count / num * 100);
    }
}
